﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Remoting.Lifetime;

namespace Dtf.Core.Remoting
{
    public class Sponsor : ISponsor
    {
        public Sponsor()
        {
            AppDomain.CurrentDomain.SetData("Sponsor", this);
        }


        public TimeSpan Renewal(ILease lease)
        {
            if (m_doNew)
            {
                return TimeSpan.FromMinutes(5);
            }
            else
            {
                return TimeSpan.FromSeconds(0);
            }
        }

        public bool DoRenew
        {
            get
            {
                return m_doNew;
            }
            set
            {
                m_doNew = value;
            }
        }

        private bool m_doNew = true;
    }
}
